﻿using Model.Dto;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Utility;

namespace Model
{
    [Serializable]
    [PrimaryKey("Id")]
    [Table("Sys_Dept")]
    public class Sys_Dept : BaseData
    {
        public string Name { get; set; }
        public int ManagerId { get; set; }
        public int ParentId { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Memo { get; set; }
        public int SortCode { get; set; }

        #region 扩展属性
        [NotMapped]
        public string ManagerName { get; set; }
        [NotMapped]
        public string ParentName { get; set; }
        /// <summary>
        /// 下级部门列表
        /// </summary>
        [NotMapped]
        public List<Sys_Dept> children { get; set; }
        [NotMapped]
        public bool isParent { get; set; }
        #endregion
    }

    /// <summary>
    /// 查询参数模型
    /// </summary>
    public class DeptQuery : BaseQueryModel
    {
        /// <summary>
        /// 名称/备注
        /// </summary>
        public string KeyWord { get; set; }

        public int? ParentId { get; set; }
    }
}
